<div class="creative-create">
    <ol class="breadcrumb">
        <li>广告中心</li>
        <li><a class="tittle-color" ui-sref="campaigns" ui-sref-opts="{reload: true}">广告投放</a></li>
        <li><a class="tittle-color" ui-sref="campaigns.promotionGroup" ui-sref-opts="{reload: true}">广告推广组</a></li>
        <li><a class="tittle-color" ui-sref="campaigns.promotionGroup.creatives" ui-sref-opts="{reload: true}">广告创意</a></li>
        <li>广告创意创建</li>
    </ol>

    <div class="clearfix mt-20 mt-10">
        <div class="col-md-6" style="border-left: 3px solid #fc3939;">{{campaigns.title.adStyleName}}</div>
    </div>
    <form class="form-horizontal" name="mainForm" novalidate>

        <div class="control-group">
            <label class="control-label form-require">广告创意名称:</label>
            <div class="controls">
                <input type="text" placeholder="广告创意名称" ng-model="creativeToSave.creativeName" name="creativeName" class="form-control" ng-blur="checkCreativeName()">
                <span ng-if="!creativeToSave.creativeName&&submited" class="cl cr"><i class="fa fa-times error" aria-hidden="true"></i>不能为空</span>

            </div>
        </div>
        <div class="control-group">
            <label class="control-label form-require">广告点击:</label>
            <div class="controls">
                <label class="radio-label"> <input type="radio" name="jumpType" value="67"
                                                   ng-model="creativeToSave.jumpType">{{table[67]}}</label>
                <label class="radio-label"> <input type="radio" name="jumpType" value="68"
                                                   ng-model="creativeToSave.jumpType">{{table[68]}}</label>
                <label class="radio-label"> <input type="radio" name="jumpType" value="69"
                                                   ng-model="creativeToSave.jumpType">{{table[69]}}</label>
            </div>


        </div>
        <div class="control-group">
            <label class="control-label form-require"></label>
            <div class="controls">
                <input ng-show="creativeToSave.jumpType==68||creativeToSave.jumpType==69" type="text"
                       class="form-control" placeholder="电话" name="phone" ng-model="creativeToSave.phone"
                        maxlength="20">

                <textarea ng-show="creativeToSave.jumpType==69" type="text" class="form-control mw-300"
                          placeholder="文本内容" name="message" ng-model="creativeToSave.message" maxlength="200">

							</textarea>

                <input type="text" class="form-control" placeholder="备用链接"  name="webUrl"
                       ng-model="creativeToSave.webUrl" maxlength=500 >
                <span ng-if="!creativeToSave.webUrl&&submited" class="cl cr"><i class="fa fa-times error" aria-hidden="true"></i>不能为空</span>

            </div>


        </div>
        <div class="mt-10">

        </div>
        <div class="control-group" ng-if="campaigns.adCampaignVO.adStyle==81||campaigns.adCampaignVO.adStyle==82">
            <label class="control-label form-require">图片:</label>
            <div class="controls">
                <div class="a-upload">
                    <input type="file" nv-file-select uploader="uploaderImage" class="form-control mw-300"multiple>选择
                </div>
            </div>
        </div>
        <div class="control-group" ng-if="campaigns.adCampaignVO.adStyle==82||campaigns.adCampaignVO.adStyle==84">
            <label class="control-label form-require">音频:</label>
            <div class="controls">
                <div class="a-upload">
                    <input type="file" nv-file-select uploader="uploaderAudio" class="form-control mw-300"multiple>选择
                </div>
            </div>
        </div>
        <div class="control-group" ng-if="campaigns.adCampaignVO.adStyle==83">
            <label class="control-label form-require">视频:</label>
            <div class="controls">
                <div class="a-upload">
                    <input type="file" nv-file-select uploader="uploaderVedio" class="form-control mw-300"multiple>选择
                </div>
            </div>
        </div>

    </form>
    <table class="table table-bordered table-hover"
           ng-if="uploaderImage.queue.length>0||uploaderVedio.queue.length>0||uploaderAudio.queue.length>0">
        <thead>
        <tr>
            <th>文件名称</th>
            <th>大小</th>
            <th>进度</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <tr ng-repeat="item in uploaderImage.queue">
            <td>{{item.file.name}}</td>
            <td>{{ item.file.size/1024/1024|number:2 }} MB</td>
            <td>
                <uib-progressbar value="item.progress">{{item.progress}}%</uib-progressbar>

            </td>
            <td>
                <i class="fa fa-trash" aria-hidden="true" style="color: red" ng-click="item.remove();removeFile('image')"></i>

            </td>
        </tr>
        <tr ng-repeat="item in uploaderAudio.queue">
            <td>{{item.file.name}}</td>
            <td>{{ item.file.size/1024/1024|number:2 }} MB</td>
            <td>
                <uib-progressbar value="item.progress">{{item.progress}}%</uib-progressbar>

            </td>
            <td><i class="fa fa-trash" aria-hidden="true" style="color: red" ng-click="item.remove();removeFile('media')";></i>
            </td>
        </tr>
        <tr ng-repeat="item in uploaderVedio.queue">
            <td>{{item.file.name}}</td>
            <td>{{ item.file.size/1024/1024|number:2 }} MB</td>
            <td>
                <uib-progressbar value="item.progress">{{item.progress}}%</uib-progressbar>

            </td>
            <td><i class="fa fa-trash" aria-hidden="true" style="color: red" ng-click="item.remove();removeFile('media')"></i>
            </td>
        </tr>
        </tbody>
    </table>


    <div class="control-group">
        <label class="control-label form-require"></label>
        <div class="controls">
            <div class="a-upload" ng-click="uploadAll()">
                <span>上传文件</span>
            </div>
        </div>
    </div>
    <br/>

    </section>
    <div class="text-center">
        <button type="button" class="btn btn-primary" ng-if="!creativeId"
                ng-click="submit()">确定
        </button>
        <button type="button" class="btn btn-primary" ng-click="edit()" ng-if="creativeId">修改</button>
        <button type="button" class="btn ims-btn" ng-click="cancel()">取消</button>
    </div>
</div>